<template>
  <excel-import
    :on-success="onSuccess"
    :on-error="onError"
    :removeBlankspace="true"
  >
    <el-button type="warning" size="small">导入EXCEL</el-button>
  </excel-import>
</template>

<script>
import { ExcelImport } from 'pikaz-excel-js'
export default {
  components: {
    ExcelImport
  },
  methods: {
    onSuccess(data, file) {
      this.$emit('excelSuccess', data)
    },
    onError(err) {
      this.$emit('excelError', err)
    }
  }
}
</script>

<style>
.excel-import {
  width: 100px;
}
</style>
